package com.dalin.platform.loa.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import com.dalin.common.base.BaseObject;
/*****************************************************************************
 * @content: 类信息                                                                                                                                *
 * @author : 那建林                                                                                                                                 *
 * @crtDate: 2011-03-07 13:44:17                                            *
 * @modDate: 2011-03-07 13:44:17                                            *
 * @version: 1.00                                                           *
 ****************************************************************************/
@Entity
@Table(name="LOA_ROLE_OPERATE")
public class LoaRoleOperateEntity extends BaseObject{
    private Long roId; // RO_ID,16,0,null
    private String lohIds; // HEADER_IDS,4000,0,null
    private String dataLevelIds; // DATA_LEVEL_IDS,4000,0,null
    private Long operateId; // OPERATE_ID,16,0,null
    private Long roleId; // ROLE_ID,16,0,null





    @Id
    @Column(name="RO_ID")
    @GeneratedValue(strategy = GenerationType.TABLE,generator="generator_normal")
    @TableGenerator(
        name = "generator_normal",
        table = "GLB_GENERATOR_KEY",
        pkColumnName = "GEN_KEY",
        valueColumnName = "GEN_VALUE",
        pkColumnValue = "LOA_ROLE_OPERATE",
        allocationSize=1
    )
    public Long getRoId() {
        return roId;
    }

    public void setRoId(Long roId) {
        this.roId = roId;
    }

    @Column(name="LOH_IDS")
    public String getLohIds() {
		return lohIds;
	}

	public void setLohIds(String lohIds) {
		this.lohIds = lohIds;
	}
	
    @Column(name="DATA_LEVEL_IDS")
    public String getDataLevelIds() {
        return dataLevelIds;
    }

	public void setDataLevelIds(String dataLevelIds) {
        this.dataLevelIds = dataLevelIds;
    }

    @Column(name="OPERATE_ID")
    public Long getOperateId() {
        return operateId;
    }

    public void setOperateId(Long operateId) {
        this.operateId = operateId;
    }

    @Column(name="ROLE_ID")
    public Long getRoleId() {
        return roleId;
    }

    public void setRoleId(Long roleId) {
        this.roleId = roleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LoaRoleOperateEntity)) return false;
        final LoaRoleOperateEntity other = (LoaRoleOperateEntity) o;
        if (roId == null) {
            if (other.roId != null) return false;
        } else if (!roId.equals(other.roId)) {
            return false;
        }
        if (dataLevelIds == null) {
            if (other.dataLevelIds != null) return false;
        } else if (!dataLevelIds.equals(other.dataLevelIds)) {
            return false;
        }
        if (operateId == null) {
            if (other.operateId != null) return false;
        } else if (!operateId.equals(other.operateId)) {
            return false;
        }
        if (roleId == null) {
            if (other.roleId != null) return false;
        } else if (!roleId.equals(other.roleId)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int njlrst = 17;
        njlrst = 31 * njlrst + (roId == null ? 0 : roId.hashCode());
        njlrst = 31 * njlrst + (dataLevelIds == null ? 0 : dataLevelIds.hashCode());
        njlrst = 31 * njlrst + (operateId == null ? 0 : operateId.hashCode());
        njlrst = 31 * njlrst + (roleId == null ? 0 : roleId.hashCode());
        return njlrst;
    }

}
